#ifndef _CBZ_SOURCE_H_
#define _CBZ_SOURCE_H_

#include "record.h"

/************** Use when need to handle source data to get frame *************/
/**
 * pre-process video pack to get video frame from source to record
 * @param[in,out] frame the video frame info and data
 * @param[in] source the record video cbz address to get source data
 * @ret if fail,return -1;if success ,return 0
 */
int cbz_video_preprocess(struct record_frame_info *frame,unsigned char *source);

/**
 * pre-process audio pack to get audio frame from source to record
 *
 * To CBZ audio source,because it's same to audio source packed,so the
 * preprocess callback also could use the audio preprocess callback.
 *
 * @param[in,out] frame the audio frame info and data
 * @param[in] source the record audio cbz address to get source data
 * @ret if fail,return -1;if success ,return 0
 * @see cbz_audio_preprocess
 */
int cbz_audio_preprocess(struct record_frame_info *frame,unsigned char *source);


/************** Use when local playback need *************/
/**
 * post-process video frame read after demuxing from record file.
 *
 * this is just a dummy,not implemented now.
 *
 * @param[in,out] outpool the output data pool to receive the video data
 * @param[in] frame the video frame read from a record file to process or
 * unpack.
 * @ret if fail,return -1; if success ,return 0
 */
int cbz_video_postprocess(unsigned char *outpool,struct record_frame_info *frame);

/**
 * post-process audio frame read after demuxing from record file
 *
 * this is just a dummy,not implemented now.
 *
 * @param[in,out] outpool the output data pool to receive the audio data
 * @param[in] frame the audio frame read from a record file to process or
 * unpack.
 * @ret if fail,return -1; if success ,return 0
 */
int cbz_audio_postprocess(unsigned char *outpool,struct record_frame_info *frame);

#endif

